package com.yzf.demo.demo.array.FailFast;

import java.util.List;

/**
 * Created by 于占峰 on 2020/3/26/026.
 */
public class ThreadAdd extends Thread {
    private List list;

    public ThreadAdd(List list) {
        this.list = list;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("lopp execute :" + i);
            try {
                Thread.sleep(5);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            list.add(i);
        }
    }
}
